<template>
  <div>
    <div id="two"></div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      option: {
        title: {
          text: '任务完成排行'
        },
        tooltip: {},
        legend: {
          data: ['任务量'],
          right: 0
        },
        xAxis: {
          data: ["张三", "李四", "王二", "小李", "小万", "小赵"]
        },
        yAxis: {},
        series: [{
          name: '任务量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        }]
      }
    }
  },
  mounted () {
    this.drawLine()
  },
  methods: {
    drawLine () {
      let myChart = this.$echarts.init(document.getElementById('two'))
      window.onresize = myChart.resize
      myChart.setOption(this.option)
    }
  }
}
</script>
<style scoped>
#two {
  width: 100%;
  height: 350px;
}
</style>